function [x_recon, l2error, uqierror,ssimerror,corr2error,time] = TVR(para,prjimg,totalIter, x0,GDIter,lamda,xtrue)



l2error=zeros(1,totalIter);
uqierror= l2error;
ssimerror=l2error;
lamda = single(lamda);
x_recon=x0;
corr2error=l2error;
time=l2error;

for iter = 1:totalIter
    tic;
    disp(iter);
    
    %mini ||Ax - b||  
    x_recon = sartReconIter(para,prjimg, x_recon,1);   
    
    %mini ||x||_tv
    x_recon = miniTV(x_recon,para,lamda,GDIter);
    
    %kill <0
    x_recon(x_recon<0) =0;
    
    toc;
    
    
    %record error
    l2error(iter) = norm(x_recon-xtrue);
    uqierror(iter) = uqi(x_recon,xtrue); 
    ssimerror(iter) = ssim(reshape(x_recon,para.nx,para.ny),reshape(xtrue,para.nx,para.ny));
    corr2error(iter) = corr2(x_recon,xtrue);
    time(iter) = toc;


end






